<?php


include_once dirname(__FILE__) . "/log.php";
include_once dirname(__FILE__) . "/inf.php";

$raw_data = file_get_contents("php://input");
if($raw_data)
{
    $to_md5 = microtime(true) . $raw_data;
    $logId = md5($to_md5);
    Log::init($logId);
    Log::debug("recv request:" . $raw_data);
    
    $args = json_decode($raw_data, true);

    $inf = new Inf();
    $rsp = $inf->serv($args);
    $rsp =  json_encode($rsp);
    Log::debug("send response:" . $rsp);

    echo $rsp;
}

?>
